home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozuti09.zoo / sozdistr / man / cat1 / make.1 < prev    next >
Encoding:
Text File  |  1995-09-03  |  17.6 KB  |  392 lines

  1.  
  2. N✓NA✓AM✓ME✓E
  3.         make - The SozobonX make
  4.  
  5. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  6.         m✓ma✓ak✓ke✓e [o✓op✓pt✓ti✓io✓on✓ns✓s] [<m✓ma✓ac✓cr✓ro✓o>=<v✓va✓al✓l>] ...  [<t✓ta✓ar✓rg✓ge✓et✓t> ...]
  7.  
  8.         l✓ld✓d [-✓-V✓Vv✓vh✓he✓ei✓ik✓kn✓np✓pq✓qr✓rs✓st✓t]✓] [-]|[-f <m✓ma✓ak✓ke✓ef✓fi✓il✓le✓e>] [-c|C <d✓di✓ir✓r>] [-L <s✓si✓iz✓ze✓e>]
  9.              [<m✓ma✓ac✓cr✓ro✓o>=<v✓va✓al✓l>] ...  [<t✓ta✓ar✓rg✓ge✓et✓t> ...]
  10.  
  11.         You  have  to keep this order in comandline: first the switches,
  12.         then macro assignements and at last the targets!
  13.  
  14. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  15.         m✓ma✓ak✓ke✓e is a tool to build one or more files from other files using
  16.         rules describing the commands how to make a file  from  another.
  17.         Therefore  dependencies are listed in a  m✓ma✓ak✓ke✓ef✓fi✓il✓le✓e and in builtin
  18.         r✓ru✓ul✓le✓es✓s so that m✓ma✓ak✓ke✓e knows which time-stamps of wich files it  has
  19.         to compare.
  20.         This  manual  describes  all  features  and options from Sozobon
  21.         make.  It is not a description of how to use  make  and  writing
  22.         makefiles.   If  you  are  not familiar with make read a general
  23.         make documentation like the  'm✓ma✓ak✓ke✓e.✓.d✓do✓oc✓c' from  this  distribution
  24.         or the  G✓GN✓NU✓U make manual.
  25.  
  26.  
  27.         T✓Th✓he✓e m✓ma✓ak✓ke✓ef✓fi✓il✓le✓e
  28.  
  29.         m✓ma✓ak✓ke✓e  looks  at  first  for  a  makefile  named   'M✓MA✓AK✓KE✓EF✓FI✓IL✓LE✓E', or
  30.         'M✓Ma✓ak✓ke✓ef✓fi✓il✓le✓e', or 'm✓ma✓ak✓ke✓ef✓fi✓il✓le✓e', if there is  none  specified  in  the
  31.         commandline.  This  file has to be in cwd.  m✓ma✓ak✓ke✓e will attempt to
  32.         use its internal rules if no makefile exists, but a  target  was
  33.         given on the command line.  This means that simple programs in a
  34.         single file can be made without a makefile by typing:
  35.             make file.ttp
  36.  
  37.          ✓ i✓in✓nc✓cl✓lu✓ud✓de✓e ✓ 
  38.              With the include directive the reading of current  m✓ma✓ak✓ke✓ef✓fi✓il✓le✓e
  39.              is  stopped,  all  specified  files  are processed like the
  40.              default  m✓ma✓ak✓ke✓ef✓fi✓il✓le✓e , and after that  the  curent    m✓ma✓ak✓ke✓ef✓fi✓il✓le✓e
  41.              processing is  continued.   Default targets are never taken
  42.              from an include file!
  43.  
  44.              i✓in✓nc✓cl✓lu✓ud✓de✓e <f✓fi✓il✓le✓e> [<f✓fi✓il✓le✓e> ...]
  45.              <✓<file>✓> may be a  macro,  known  at  this  state,  and  have
  46.              wildcards.    Include  files  are searched like the ones in
  47.              $✓$M✓MA✓AK✓KE✓EF✓FI✓IL✓LE✓ES✓S.
  48.  
  49.          ✓ l✓li✓in✓ne✓e ✓ c✓co✓on✓nt✓ti✓in✓nu✓ua✓at✓ti✓io✓on✓n ✓ 
  50.              The line continuation character is '\✓\'.  Back  slashes  may
  51.              appear  in  pathname,  but  NOT at the end of a line, as it
  52.              will be taken as a continuation backslash,  and  not  as  a
  53.              part of  the  pathname.    This  should  not create any big
  54.              problem as far as i can see - just add a space  at  and  of
  55.              line.
  56.  
  57.         R✓Ru✓ul✓le✓es✓s
  58.  
  59.         If  for  a  target  with  an  extension  (!!)  no  commands  are
  60.         specified, make tries to find an implicit rule that matches this
  61.         target by testing possible dependencies.  The assumed dependency
  62.         is added to the target's dependency list, if it exists.  If not,
  63.         the extension of the assumed dependancy  is  compared  with  the
  64.         first  depandancy  of  the target, if it's the same the matching
  65.         implicit rule will be used  for  this  target.    To  pervent  a
  66.         problem  with  linking  all  dependencies (default rule) and im-
  67.         plicit adding an assumed target, this not added for the  default
  68.         target (if there are any dependencies).  So:
  69.                    foo.ttp:  bar.o x.o y.o 
  70.         will run the linker with the commandline:  
  71.                    cc -o foo.ttp bar.o x.o y.o 
  72.         And not add any dependency 'foo.o'. The imlicit rule used is:
  73.                    .o.ttp:  $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES)
  74.         The implicit rule used for a default target is searched by look-
  75.         ing at  the first dependency's suffix too!  Think of this if you
  76.         specify dependencies with different suffixes!  For  the  default
  77.         target you will have to write your own command(s) in this case.
  78.         The implicit rules are always suffix rules.  So your targets and
  79.         dependencies  must  have  a  suffix  form   '.✓.S✓SU✓UF✓FF✓FF✓FI✓IX✓XE✓ES✓S' if they
  80.         should be made with an implicit rule.  You can of course  define
  81.         new implicit rules, or overwrite built-in ones.  Don't forget to
  82.         add the new suffixes to  '.✓.S✓SU✓UF✓FF✓FI✓IX✓XE✓ES✓S'!
  83.  
  84.         The  most  important  builtin  rules  are: (you can see all with
  85.         option -✓-p✓p.)
  86.             .c.o:
  87.                 $(CC) -c $(CFLAGS) $<
  88.         
  89.             .s.o:
  90.                 $(CC) -c $(CFLAGS) $<
  91.         
  92.             .c.ttp:
  93.                 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LOADLIBES)
  94.         
  95.             .o.ttp:
  96.                 $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES)
  97.         
  98.             .s.ttp:
  99.                 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LOADLIBES)
  100.         
  101.             .l.c:
  102.                 $(LEX) $(LFLAGS) $<
  103.         
  104.             .y.c:
  105.                 $(YACC) $(YFLAGS) $<
  106.  
  107.         M✓Ma✓ac✓cr✓ro✓os✓s
  108.  
  109.         Macros are normally set in the following order:
  110.                internal defaults
  111.                environment variables        EXPORTED
  112.                makefile assignments
  113.             commandline assignements    EXPORTED
  114.         If the  -✓-e✓e assignments in the makefile and the order becomes:
  115.                internal defaults
  116.                makefile assignments
  117.                environment variables        EXPORTED
  118.             commandline assignements    EXPORTED
  119.  
  120.         Internal (predefined) macros are:
  121.             PATH = \usr\bin,\bin
  122.             SHPREFIX = -c
  123.             CC = cc
  124.             AR = ar
  125.             TEX = tex
  126.             LEX = lex
  127.             YACC = yacc
  128.             CFLAGS =
  129.             LDFLAGS =
  130.             LOADLIBES =
  131.             TFLAGS =
  132.             ARFLAGS =
  133.             MAKE = make
  134.             MAKEFLAGS = 
  135.         The macros $(M✓MA✓AK✓KE✓E) and  $(M✓MA✓AK✓KE✓EF✓FL✓LA✓AG✓GS✓S)  are  set  to  the  values,
  136.         m✓ma✓ak✓ke✓e was  invoked  with.    The  -✓-c✓c and the -✓-f✓f switch with their
  137.         arguments are of course not inherited into  macro  $(M✓MA✓AK✓KE✓EF✓FL✓LA✓AG✓GS✓S).
  138.         Both  are  not exported by default, but maybe used to run nested
  139.         makefiles and, if you want so, keeping  the  options  the  first
  140.         m✓ma✓ak✓ke✓e was started with.
  141.  
  142.         The  syntax  for  recognizing  a  macro/variable  is:  $✓$(✓(VAR)✓) or
  143.         $✓${✓{VAR}✓},✓, where 'V✓VA✓AR✓R' is the variable/macro name.    To  define  a
  144.         variable/macro  in  a  makefile write: '<m✓ma✓ac✓cr✓ro✓o> =✓= <v✓va✓al✓lu✓ue✓e>' where
  145.         the rest of the line gets the value, skipping leading and trail-
  146.         ing whitespaces.
  147.         A macro/variable is evaluted immediately when found while  read-
  148.         ing  the  makefile, if it is part of another variable's value, a
  149.         target, a dependency or any statement's argument.
  150.         It is evaluated when used, if it is in a commandline in a  rule,
  151.         or in a commandline for an explicit target.
  152.         Special  variables  with  the  syntax  %✓%(✓(VAR)✓) or %✓%{✓{VAR}✓} are only
  153.         allowed in dependency lists.  These  variables  make  it  easier
  154.         e.g.   to add a dependency build from the name of the target but
  155.         without the path part there:
  156.             $(OBJECTS): %(*F).c $(HEADERS)
  157.                 cc -o $(*).o $(*F).c
  158.         This is expanded for every target in $(OBJECTS) to:
  159.             <pathtarget.suffix>: <target>.c 1.h 2.h ..
  160.                 cc -o pathtarget.o target.c
  161.  
  162.          ✓ b✓bu✓ui✓il✓lt✓ti✓in✓ns✓s ✓ 
  163.  
  164.          ✓ e✓ex✓xp✓po✓or✓rt✓t ✓ 
  165.              Global export: Export all macros  from  makefiles  via  en-
  166.              vironment  to  subsequent processes (nested makes, or other
  167.              child processes).  this directive works only if no unexport
  168.              follows
  169.  
  170.          ✓ e✓ex✓xp✓po✓or✓rt✓t ✓  <m✓ma✓ac✓cr✓ro✓o>  ... 
  171.              Export all specified macros as environment variables,  they
  172.              must  not  exist until this directive is read, a global un-
  173.              export does not affect this directive.
  174.  
  175.          ✓ e✓ex✓xp✓po✓or✓rt✓t ✓  <m✓ma✓ac✓cr✓ro✓o>  = <value> 
  176.              Defines a macro and makes it exportable at same time.
  177.              Exported macros  are  expanded  before  putting  them  into
  178.              environment!   In  a  subsequent  make  you can use them as
  179.              macros again.
  180.  
  181.          ✓ u✓un✓ne✓ex✓xp✓po✓or✓rt✓t ✓ 
  182.              Don't export any macros from any makefile; this is default,
  183.              and resets only a earlier  global  export  directive  (from
  184.              another  included  makefile  perhaps);  the  last export or
  185.              unexport directive is valid
  186.  
  187.          ✓ u✓un✓ne✓ex✓xp✓po✓or✓rt✓t ✓  <m✓ma✓ac✓cr✓ro✓o>  ... 
  188.              Do not export the specified macros, even environment  vari-
  189.              ables  or  commandline  assignements are affected; a global
  190.              export directive does not change the macros' status.
  191.  
  192.          ✓ u✓un✓ne✓ex✓xp✓po✓or✓rt✓t ✓  <m✓ma✓ac✓cr✓ro✓o>  = <value> 
  193.              Define a macro and make it private (usefull if  it  was  an
  194.              environment variable).
  195.  
  196.          ✓ o✓ov✓ve✓er✓rr✓ri✓id✓de✓e ✓  <m✓ma✓ac✓cr✓ro✓o>  = value 
  197.              Define  a macro and prevent it from being overwritten; sub-
  198.              sequent assignements to this macro (e.g. from  commandline)
  199.              will  not replace the current value, but be appended to the
  200.              end.
  201.  
  202.         P✓Ph✓ho✓on✓ny✓y (✓(s✓sp✓pe✓ec✓ci✓ia✓al✓l)✓) T✓Ta✓ar✓rg✓ge✓et✓ts✓s
  203.  
  204.  
  205.          ✓ .✓.S✓SU✓UF✓FF✓FI✓IX✓XE✓ES✓S ✓ 
  206.                 The list of dependecies, recognized by make.
  207.  
  208.          ✓ .✓.P✓PR✓RE✓EC✓CI✓IO✓OU✓US✓S ✓ 
  209.                 Dependencies of .PRECIOUS are not deleted if  a  command
  210.                 fails, by default it has no dependencies.
  211.  
  212.          ✓ .✓.I✓IG✓GN✓NO✓OR✓RE✓E ✓ 
  213.                 Sets a global switch like  -✓-i✓i (ignore).
  214.  
  215.          ✓ .✓.S✓SI✓IL✓LE✓EN✓NT✓T ✓ 
  216.                 Sets a global switch like  -✓-s✓s (silent).
  217.  
  218.          ✓ .✓.S✓ST✓TR✓RI✓IP✓PP✓PA✓AT✓TH✓H ✓ 
  219.                 The  path  part  of every target's name is stripped when
  220.                 making the implicit dependency.  This makes it easier to
  221.                 compile objects from a sourcecode for different  program
  222.                 versions into diffferent directories.  This is some sort
  223.                 of a global %✓%(✓(*✓*F✓F)✓) for all inplicit dependencies.
  224.  
  225.          ✓ .✓.S✓SH✓HE✓EL✓LL✓L ✓ 
  226.                 Sets a global switch: all commandlines are passed to the
  227.                 shell  $✓$S✓SH✓HE✓EL✓LL✓L.
  228.  
  229.         C✓Co✓om✓mm✓ma✓an✓nd✓dl✓li✓in✓ne✓e P✓Pr✓re✓ef✓fi✓ix✓xe✓es✓s
  230.  
  231.         You can prefix each commandline in the makefile with one or more
  232.         of the following prefix chars.  The '@✓@' and '-✓-' prefixes must be
  233.         first ones,  the  excluding  '%✓%'  and  '!✓!'  may  follow.   These
  234.         prefixes modify the commandline handling.
  235.  
  236.          ✓ @✓@ ✓ 
  237.                 Sets the silent switch to this single comandline.
  238.  
  239.          ✓ -✓- ✓ 
  240.                 Sets the ignore switch to this single comandline.
  241.  
  242.          ✓ !✓! ✓  ✓ 
  243.                 By default this make executes all commandlines by  self.
  244.                 This  prefix  makes m✓ma✓ak✓ke✓e to pass this single commandline
  245.                 to a shell.  This is an important feature,  cause   m✓ma✓ak✓ke✓e
  246.                 performs  no  expansions  than wildcard expansion on the
  247.                 commandlines.
  248.  
  249.          ✓ %✓% ✓ 
  250.                 Forces make to treat the command  in  this  line  as  an
  251.                 builtin one.
  252.  
  253.         A✓Au✓ut✓to✓om✓ma✓at✓ti✓ic✓c v✓va✓ar✓ri✓ia✓ab✓bl✓le✓es✓s
  254.  
  255.  
  256.          ✓ $✓$@✓@ ✓ 
  257.                 Is  the  current  target  of an implicit rule, or an ex-
  258.                 plicit one with multiple targets.  $✓$(✓(@✓@F✓F)✓) is the filename
  259.                 part of  $✓$@✓@ , and  $✓$(✓(@✓@D✓D)✓) the path in  $✓$@✓@.
  260.  
  261.          ✓ $✓$*✓* ✓ 
  262.                 This the basename of the curent target.  This works only
  263.                 if the target has a recognized suffix.    $✓$(✓(*✓*F✓F)✓)  is  the
  264.                 filename part of  $✓$*✓* , and  $✓$(✓(*✓*D✓D)✓) the path in  $✓$*✓*
  265.          ✓ $✓$<✓< ✓ 
  266.                 This is the name of the first dependency.  If the target
  267.                 got  it's  commands  from an implicit rule, this will be
  268.                 the first dependency added by this rule.  $✓$(✓(<✓<F✓F)✓)  is  the
  269.                 filename part of  $✓$<✓< , and  $✓$(✓(<✓<D✓D)✓) the path in  $✓$<✓<
  270.  
  271.          ✓ $✓$^✓^ ✓ 
  272.                 This  macro contains the names of all dependencies, with
  273.                 spaces between them.   This  is  useful  for  linking  a
  274.                 file.  (See default rules).
  275.  
  276.          ✓ $✓$?✓? ✓  ✓ 
  277.                 The  names  of  all dependencies that are newer than the
  278.                 target, with spaces between them.  This maybe useful  in
  279.                 explicit  rules  when  you  want  to  work only with the
  280.                 changed files.  For example to update an archive:
  281.  
  282.         W✓Wi✓il✓ld✓dc✓ca✓ar✓rd✓ds✓s
  283.  
  284.         This make tries to expand  every  token  containing  a  wildcard
  285.         character like:    '*✓*' or  '?✓?' or  '[✓[' as a filename.  The token
  286.         is replaced by the matching filenames  found.    It  uses  usual
  287.         FNRexpressions as wildcards: '*' '?' '[...]' '[?-?]' '[^...]'
  288.  
  289. O✓OP✓PT✓TI✓IO✓ON✓NS✓S
  290.  
  291.          ✓ -✓--✓-v✓ve✓er✓rs✓si✓io✓on✓n ✓ 
  292.          ✓ -✓-V✓V ✓ 
  293.              Print detailed Version information to stdout and exit
  294.  
  295.          ✓ -✓--✓-h✓he✓el✓lp✓p ✓ 
  296.          ✓ -✓-h✓h ✓ 
  297.              Print the help page and exit
  298.  
  299.          ✓ -✓-v✓v ✓   (verbose) 
  300.              Generally  show  more information about what  m✓ma✓ak✓ke✓e is doing
  301.              and print short version information (to stderr).
  302.  
  303.          ✓ -✓- ✓ 
  304.              Read the  m✓ma✓ak✓ke✓ef✓fi✓il✓le✓e from stdin.
  305.  
  306.          ✓ -✓-c✓c ✓  <d✓di✓ir✓r>  (cd) 
  307.              Change the current working directory to  <d✓di✓ir✓r> before  run-
  308.              ning (and looking for a makefile).
  309.  
  310.          ✓ -✓-f✓f ✓  <f✓fi✓il✓le✓e>  (file) 
  311.              Use and read file <f✓fi✓il✓le✓e> as makefile.
  312.  
  313.          ✓ -✓-L✓L ✓  <s✓si✓iz✓ze✓e>  (line) 
  314.              Set  the  internal buffer size for reading and expand lines
  315.              from a makefile to <✓<s✓si✓iz✓ze✓e>✓> KBytes. Default size is  4K,  you
  316.                           l✓li✓in✓ne✓e ✓ t✓to✓oo✓o ✓ l✓lo✓on✓ng✓g or a similiar one.
  317.  
  318.          ✓ -✓-e✓e ✓   (env) 
  319.            The   environment   variables   overwrite   the    makefile's
  320.            variables.
  321.  
  322.          ✓ -✓-s✓s ✓   (silent) 
  323.            Don't print anything except error messages.
  324.  
  325.          ✓ -✓-i✓i ✓   (ignore) 
  326.            Ignore  the exit status of the commands excuted by make: just
  327.            execute all comands.
  328.  
  329.          ✓ -✓-k✓k ✓   (keep) 
  330.            Keep going on processing the makefile after an error.    This
  331.            is  much  better  than  -✓-i✓i cause the next target will be made
  332.            after an error until make can't do anything more.
  333.  
  334.          ✓ -✓-n✓n ✓ 
  335.           Do nothing, just tell what make would  do  (e.g.  for  testing
  336.           makefiles).
  337.  
  338.          ✓ -✓-q✓q ✓   (question) 
  339.            Do nothing but test the target.  If it is not up to date make
  340.            will return a status of 1.
  341.  
  342.          ✓ -✓-t✓t ✓   (touch) 
  343.            Don't really make any targets, but touch the files which need
  344.            an update.
  345.  
  346. E✓EN✓NV✓VI✓IR✓RO✓ON✓NM✓ME✓EN✓NT✓T
  347.         The  environment  is  read and macros corresponding to the vari-
  348.         ables found are initialized within make.  This means  that  set-
  349.         ting  the  variable  $✓$P✓PA✓AT✓TH✓H causes make to set the macro  P✓PA✓AT✓TH✓H to
  350.         the value found and use that for command searches  as  described
  351.         above.   With  a  macro assignement in commandline you can over-
  352.         write any macro, from makefile and environment, too.
  353.  
  354.         If a environment variable  '$✓$M✓MA✓AK✓KE✓EF✓FI✓IL✓LE✓ES✓S' exists,  it's  value  is
  355.         used as  a  list of makefiles to include.  The default target is
  356.         never taken from one of  these  files,  but  they  are  read  at
  357.         first.    If  there  are  no  absolut  paths  specified  in  the
  358.         filenames, they are searched in the paths of '$INCLUDEDIR' and a
  359.         directory 'make' in that path.  If there is no environment vari-
  360.         able '$INCLUDEDIR'  or  '$INCLUDE'  (a  list  of  inlude  paths)
  361.         '\usr\include,\usr\local\include' is assumed.
  362.  
  363.         $✓$I✓IN✓NC✓CL✓LU✓UD✓DE✓ED✓DI✓IR✓R  This  path  replaces  the builtin search pathes for
  364.         include makefiles not to find in cwd.
  365.  
  366.         $✓$I✓IN✓NC✓CL✓LD✓DU✓UE✓E A  list  of  pathes  where  makefiles  to  incldue  are
  367.         searched.  If  $✓$S✓ST✓TD✓DE✓ER✓RR✓R is present, stderr handle (2) is used for
  368.         diagnostic output.
  369.  
  370. D✓DI✓IA✓AG✓GN✓NO✓OS✓ST✓TI✓IC✓CS✓S
  371.         m✓ma✓ak✓ke✓e  will  claim  about  a  missing target, if there is none in
  372.         commandline or the  makefile.  If it finds a syntax error in the
  373.         makefile it will report this and exit.
  374.  
  375. S✓SE✓EE✓E ✓ A✓AL✓LS✓SO✓O
  376.         cc(1)
  377.  
  378. B✓BU✓UG✓GS✓S
  379.         Without doubt, there are some bugs in  this  program.    If  you
  380.         discover one, please report it to maintainer.
  381.  
  382. A✓AU✓UT✓TH✓HO✓OR✓R
  383.         PD make Adapted from mod.sources Vol 7 Issue 71, 1986-12-03.
  384.         port to ATARI TOS by Jwahar Bammi & Ton van Overbeek
  385.         adapted for SOZOBON by Tony Andrews 1988
  386.  
  387.         eXtended Version by Jerry G Geiger (1992-1995)
  388.  
  389. V✓VE✓ER✓RS✓SI✓IO✓ON✓N
  390.         make V2.04 Mar 30 1995
  391.  
  392.